home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / webtp55.zip / SHIFTOPT.CHI < prev    next >
Text File  |  1989-11-30  |  278b  |  13 lines

  1. @ @p
  2. procedure ShiftOptDemo;
  3. var
  4.   a,b: word;
  5. Begin
  6.   a:= b mod 256; { using "/m" you get: a:= b and 255!}
  7.   a:= b mod 3; {unchanged}
  8.   a:= b div 4; { using "/d" you get: a:= b shr 2}
  9.   a:= b div 3; {unchanged}
  10.   a:= b shr 4 +1; {don't 'optimize' to a shr 5}
  11. End;
  12.  
  13.